Test::Shlomif::Harness - Giving Test::Harness a Face Lift

Shlomi Fish on 2005-11-05T22:28:59

It all started when I attended a presentation about TestOOB in the first new Israeli Pythoneers meeting. One thing that was mentioned there was that it enabled colouring the output of the tests.

Then I decided I wanted the same, only for the final line of the tests in the "make test" or "./Build test" output. So I looked at Test::Harness, but then saw that the line printing the OK was buried deep inside the conditional of a certain function, without an ability to easily override it. Not to mention that the entire module was not object oriented, so over-riding functions there was kind of a black magic.

I posted a message to perl-qa asking if someone knew of a good way to do it. Then I noted that I'd like to spin Test::Harness off and create a better module while possibly breaking the semantics a lot of the internals. The reply of Andy Lester (the Test::Harness maintainer) was "Show me the Code".

It took me some time, but I finally came to it. I renamed Test::Harness into Test::Shlomif::Harness and started heavily refactoring and revamping it: converting it to an object, extracting methods, converting hashes into objects, moving function parameters to instance variables, and generally giving it some loove. My first

I announced my first release to perl-qa as well. Michael Schwern wrote a message with some errata, which I incorporated. Andy also had something to say, and this started an active discussion.

Since then I did more refactorings and stuff. Today, I released version 0.0100_04 onto a non-suspecting world. (especially for this announcement). The code is maintained in a Subversion repository as part of the web-cpan project on Berlios, so the most up-to-date version is available there.

Test::Shlomif::Harness is only a temporary name, but I hope to release it into CPAN soon. Ironically, I did not yet implement a derived class that does the colour highlighting of the output.